from odoo import models, fields, api, _
from odoo.exceptions import UserError, ValidationError


# 审批流类
class Workflow(models.Model):
    _inherit = 'sb.workflow'

    workflow_type = fields.Selection(selection_add=[
        ('clamping_f', 'Clamping fixture'),
    ], ondelete={'activity': 'cascade'})
    # 关联销售单据
    sb_fixture_subscription_id = fields.Many2one('sb.fixture.subscription', string="Fixture Subscription", ondelete="cascade")
    fixture_subscription_ids = fields.One2many('sb.fixture.subscription.item',
                               related="sb_fixture_subscription_id.sb_fixture_subscription_item_ids")
